#include "MeshObject.h"
#include "SampleContext.h"

__ImplementClass(MeshObject,'Mesh',Object)

MeshObject::MeshObject()
{
    m_pEntity = NULL;
}

MeshObject::~MeshObject()
{

}

void MeshObject::setName(std::string &name)
{
	Object::setName(name);
	SceneManager* pSceneManager = Root::getSingletonPtr()->getSceneManager("DummyScene");
	if (pSceneManager)
	{
		m_pEntity = pSceneManager->createEntity(name,name);
		/*
		Ogre::SceneNode *pAllocNode = pSceneManager->getRootSceneNode()->createChildSceneNode( "objectNode", Vector3( 0, 0, 0 ) );
		if (pAllocNode)
		{
			pAllocNode->setPosition(-11566,40.7,-12540);
			Radian rfAngle(90);
			Vector3 rkAxis(0,0,1);
			float fScale = 200;
			pAllocNode->setScale(fScale,fScale,fScale);
			Quaternion Qt(rfAngle,rkAxis);
			//pAllocNode->setOrientation(Qt);
			pAllocNode->attachObject(entObject);
		}

		Ogre::AnimationState* as = entObject->getAnimationState("run");
		if(as)
		{   
			as->setEnabled(true);
			as->setLoop(true);
			SAMPLECONTEXT->addAnimStates(as);
		}
		*/
	}


}

void MeshObject::Update(float delta)
{

}
